﻿using mvcForum.Core.Interfaces.Data;
using System;
using System.Linq.Expressions;

namespace mvcForum.Core.Specifications {

	public static class PostReportSpecifications {

		public class SpecificPost : ISpecification<PostReport> {
			private readonly Post post;

			public SpecificPost(Post post) {
				this.post = post;
			}

			public Expression<Func<PostReport, Boolean>> IsSatisfied {
				get {
					return x => x.PostId == post.Id;
				}
			}
		}

		public class NotResolved : ISpecification<PostReport> {

			public NotResolved() { }

			public Expression<Func<PostReport, Boolean>> IsSatisfied {
				get {
					return x => !x.Resolved;
				}
			}
		}
	}
}